
	$(function() {
        setFontSize(1080)

		var token = localStorage.phone;
		var money = '';
		var wechat = '';
		var alipay = '';
		var teacher_id = '';
		$.ajax({
			url: "https://newapp.icandrive.cn/api/cash_get_page.php",
			type: 'post',
			data: {
				token: token
			},
			dataType: 'json',
			success: function(data) {

				if(data.status == 200) {
					$(data.dataing).each(function() {
						$('span[name=span]').html(this.money);
						money = this.money;
						wechat = this.wechat_account;
						alipay = this.alipay_account;
						teacher_id = this.teacher_id;
					})
				}
			}

		});
		$('#cash').click(function() {

			localStorage.money = money;
			localStorage.wechat = wechat;
			localStorage.alipay = alipay;
			window.location.href = '../cashpage/cashpage.html';
		});
		$('.detail').click(function() {
			localStorage.teacher_id = teacher_id;
			window.location.href = '../detail/detail.html';
		});

		$('.plan').click(function() {
		window.location.href = '../plan/plan_1.html';
	})
});

/*监听手机返回按键*/
document.addEventListener("plusready", function() {
	// 注册返回按键事件
	plus.key.addEventListener('backbutton', function() {
		// 事件处理
		plus.nativeUI.confirm("退出程序？", function(event) {
			if(event.index) {
				plus.runtime.quit();
			}
		}, null, ["取消", "确定"]);
	}, false);
});
